package math

import (
	"jvm/instructions/base"
	"jvm/rtda"
)

// Boolean XOR int
type IXOR struct{ base.NoOperandsInstruction }

func (x *IXOR) Execute(jFrame *rtda.JFrame) {
	stack := jFrame.OperandStack()
	v1 := stack.PopInt()
	v2 := stack.PopInt()
	result := v1 ^ v2
	stack.PushInt(result)
}

// Boolean XOR long
type LXOR struct{ base.NoOperandsInstruction }

func (x *LXOR) Execute(jFrame *rtda.JFrame) {
	stack := jFrame.OperandStack()
	v1 := stack.PopLong()
	v2 := stack.PopLong()
	result := v1 ^ v2
	stack.PushLong(result)
}
